import java.util.Scanner;
public class test_1 {
    public static void main(String[] args) {
        Scanner sc =new Scanner(System.in);
        int num1 = sc.nextInt();
        int num2 = sc.nextInt();
        int i=0,j=0;
        if (num1>num2){
            int i1=num1;
            num1=num2;
            num2=i1;
        }
        i=num1;
        j=num2;
        while (i!=0){
            int t=j%i;
            j=i;
            i=t;
        }
        System.out.println("最大公约数："+j);
        System.out.println("最小公倍数："+((num2*num1)/j));
    }
}
